var express = require('express');
var router = express.Router();
var { userModel } = require('../db/model')
/* GET home page. */
router.get('/', function (req, res, next) {
  res.render('index', { title: 'Express' });
});
router.get('/user', async (req, res, next) => {
  const data = await userModel.find()
  res.send({ code: 200, data })
});
module.exports = router;
